Add git hashes to commits metadata#2708
Merged
lutien merged 4 commits intomozilla:masterfrom Mar 13, 2026
Merged
Conversation
006b358 to
07c4824
Compare
jgraham
requested changes
Mar 2, 2026
sync/lando.py
Outdated
| return _git_to_hg, _hg_to_git | ||
|
|
||
|
|
||
| def _save_new_hashes(git_hash: str, hg_hash: str) -> None: |
Member
There was a problem hiding this comment.
Is there a reason to to add the mapping to the per-commit metadata in the repository (i.e. the git notes for each commit), and read that? We could consider a one-time import of the CSV file to backfill existing data (but that could be overkill; I think it's pretty likely we ~never read these older commits, unless I'm forgetting something).
sync/commit.py
Outdated
| return self.sha1 | ||
|
|
||
| @property | ||
| def git_rev(self) -> str: |
Member
There was a problem hiding this comment.
I think the naming here is getting confusing because for mozilla-central we have three different possible revisions, two of which are git. Maybe we should call it canonical_rev_git. Here the implementation would look like:
@property
def canonical_rev_git(self) -> str:
if self.cinnabar:
raise ValueError(f"Commit {self.sha1} doesn't have a canonical git SHA1")
return self.sha1But then in GeckoCommit you'd override it to:
@property
def canonical_rev_git(self) -> str:
if self.cinnabar:
if "gecko-commit-git" not in self.notes:
self.notes["gecko-commit-git"] = hg2git(self.sha1)
sha1 = self.notes["gecko-commit-git"]
assert sha1 is not None
return sha1
return self.sha12fb771b to
3e476c1
Compare
jgraham
requested changes
Mar 9, 2026
jgraham
approved these changes
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted the part about adding the git hashes to commits metadata from #2658.